<template>
  <div class="takle" @scroll="askmenu($event)">
    <div class="qqqq" id="ddb">
      <b class="closex" @click="closex">X</b>
      <h1>qqqqqqqq</h1>
    </div>
    <div class="butoo">
      <el-button type="primary" @click="alertt($event)" :disabled=ltde>同意</el-button>
      <el-button type="primary" @click="alertt($event)" :disabled=ltde>不同意</el-button>
    </div>
  </div>
</template>

<script>
  export default {
    data(){
      return{
        ltde:true
    }
    },
    methods:{
      closex () {
        this.$emit('ff',false);//关闭弹框
        $('.takle').scrollTop(0)
        if( $('.qqqq').height() == $('.takle').height()){
          this.ltde=false
        }else{
          this.ltde=true
        }

      },
      alertt(e){
        this.$emit('ff',false);//关闭弹框
        if($(e.currentTarget).index()==0){
          this.$emit('gg',true);//打开二级弹框
        }else{
          this.$emit('gg',false);
        }
        $('.takle').scrollTop(0)
        if( $('.qqqq').height() == $('.takle').height()){
          this.ltde=false
        }else{
          this.ltde=true
        }
      },
      askmenu(e) {
        this.scroll=$(e.currentTarget).scrollTop();
//        console.log($(e.currentTarget).height())
//        console.log(this.scroll)
//        console.log($('.qqqq').height())
        var iheight= $('.qqqq').height() - $(e.currentTarget).height()
        if(this.scroll==iheight){
          this.ltde=false
          this.$emit('ee',false);
        }else{

        }
      },
      pink(){
        if( $('.qqqq').height() == $('.takle').height()){
          this.ltde=false
        }else{
          this.ltde=true
        }

      }

    },

  mounted () {
    this.pink()
  },
  components: {

  }
  }
</script>

<style scoped>

    .takle{
      width:700px;
      height:400px;
      /*background:#50bfff;*/
      overflow-y:scroll ;
      position:relative;
    }
.qqqq{
  width:100%;
  min-height:500px;
}
.butoo{
  width:100%;
  height:40px;
  /*background: palevioletred;*/
  position: fixed;
  left:0;
  bottom: 10px;
}
    .closex{
      width:20px;
      height:20px;
      line-height:20px;
      position: fixed;
      right:10px;
      top: 10px;
      border-radius: 50%;
      background:#50bfff;
    }
    .closex:hover{
      cursor: pointer;
    }
 .butoo button{
   width:90px;
   /*height:30px;*/

 }
</style>
